/**
 * Created By zhangQ 2018/3/7
 */
import axiosUtils from '@api/env/axiosEnv'

let customAxios = axiosUtils._initAxios()

export function getContainerList (param) {
  return customAxios({
    url: '/container/tainer/getContainerList',
    method: 'post',
    data: {
      page: param.page,
      pageSize: param.pageSize,
      like: param.like
    }
  })
}

export function putcontainer (param) {
  return customAxios({
    url: '/container/tainer/putContainer',
    method: 'post',
    data: {
      containerNo: param.containerNo
    }
  })
}

export function putContainerList (param) {
  return customAxios({
    url: '/container/tainer/putContainerList',
    method: 'post',
    data: {
      containerHead: param.containerHead,
      containerBodyStart: param.containerBodyStart,
      containerBodyEnd: param.containerBodyEnd
    }
  })
}

export function deleteContainers (param) {
  return customAxios({
    url: '/container/tainer/deleteContainers',
    method: 'post',
    data: {
      containers: param.containers
    }
  })
}

export function batchDeleteContainers (param) {
  return customAxios({
    url: '/container/tainer/batchDeleteContainers',
    method: 'post',
    data: {
      ids: param.ids
    }
  })
}

export function getContainerPosition (param) {
  console.log(param)
  return customAxios({
    url: '/container/tainer/getContainerPosition',
    method: 'post',
    data: {
      containerNo: param.containerNo,
      page: param.page,
      pageSize: param.pageSize
    }
  })
}

export function putExcelContainerList (param) {
  return customAxios({
    url: '/container/tainer/putExcelContainerList',
    timeout: 1200000,
    method: 'post',
    data: param,
    headers: {'Content-Type': 'multipart/form-data'}
  })
}
